import { Route } from "@/api/interface/sysManagement";
import { ResultData } from "@/api/interface/index";
import { BASE } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 线路管理模块
 */
// 获取线路列表
export const getRouterListApi = () => {
  return http.get<Route.ResRouteList[]>(BASE + `/route/`);
};

// 新增线路列表
export const createRouterApi = (params: Route.ResRouteList) => {
  return http.post<ResultData>(BASE + `/route/`, params);
};

// 编辑线路列表
export const editRouterApi = (id: number, params: Route.ResRouteList) => {
  return http.put<ResultData>(BASE + `/route/${id}/`, params);
};

// 删除线路列表
export const delRouterApi = (id: number) => {
  return http.delete<ResultData>(BASE + `/route/${id}/`);
};
